package com.jf.cloud.api.product.feign;

import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zz
 * @date 2022/11/17 15:24
 */
@FeignClient(value = "jfcloud-product",contextId = "skuStock")
public interface SkuStockFeignClient {

    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/sku/stock/getbyId")
    ServerResponseEntity<Integer> getBySkuId(@RequestParam("skuId") Long skuId);
    /**
     * 根据商品id获取总库存
     * @param spuId
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/sku/stock/getTotalStockBySpuId")
    ServerResponseEntity<Integer> getTotalStockBySpuId(@RequestParam("spuId") Long spuId);
}
